<script th:src="@{/scripts/user/edit.js}"></script>
<form id="saveForm" method="post">
    <input type="hidden" name="id" id="id" th:value="${user.id}"/>
    <div class="addInfBtn">
        <h3 class="itemTit"><span>用户信息</span></h3>
        <table class="addNewInfList">
            <tr>
                <th>名称</th>
                <td width="240">
                    <input class="inp-list w-200 clear-mr f-left" type="text"
                           id="name" name="name" maxlength="32"
                           th:value="${user.name}"/>
                    <span class="tipStar f-left">*</span>
                </td>
                <th>生日</th>
                <td width="240">
                    <input onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                           type="text" class="inp-list w-200 clear-mr f-left"
                           th:value="${user.date} ? ${#dates.format(user.date,'yyyy-MM-dd HH:mm:ss')} :''"
                           readonly="true"/>
                </td>
            </tr>
            <tr>
                <th>账户</th>
                <td width="240">
                    <input class="inp-list w-200 clear-mr f-left" type="text"
                           name="username" id="username" maxlength="32"
                           th:value="${user.username}"/>
                </td>
                <th>密码</th>
                <td width="240">
                    <input class="inp-list w-200 clear-mr f-left"
                           type="password" name="password" id="password"
                           maxlength="32" th:value="${user.password}"/>
                </td>
            </tr>
            <tr>
                <th>部门</th>
                <td width="240">
                    <div class="selectDownMode f-left w-206">
                        <input type="text" th:if="${user.department==null}"
                               value="请选择"/>
                        <select class="selectMode" name="department"
                                id="department">
                            <option value="">请选择</option>
                            <option th:each="department:${user.department}"
                                    th:value="${department.id}"
                                    th:text="${department.name}"
                                    th:selected="${user.department.id == department.id}"></option>
                        </select>
                    </div>
                </td>

                <th>角色</th>
                <td width="240">
                    <div>
                        <select name="roles" id="roles" multiple="multiple">
                            <option th:each="role:${roles}"
                                    th:value="${role.id}"
                                    th:text="${role.name}"
                                    th:selected="${#lists.contains(userRoleIds, role.id)}"></option>
                        </select>
                    </div>
                </td>
            </tr>
        </table>
        <div class="bottomBtnBox">
            <a class="btn-93X38 saveBtn" href="javascript:void(0)">确定</a>
            <a class="btn-93X38 backBtn" href="javascript:closeDialog(0)">返回</a>
        </div>
    </div>

</form>